#  author:张靖昆 date:2020/3/6 name:5_函数 IDE:PyCharm

user = {'id': "admin", 'pwd': '666'}
def login(name, password,role=2):
    if name == user['id'] and password == user['pwd']:
        print('role',role)
        return True
    else:
        return False  # 返回值

user_id = 'admin'
user_password = '666'
# 传值，把数据传入方法中
result = login(user_id, user_password)

print(result)

